<?php    
header('Content-type: application/xls');
header("Content-Disposition:attachment;filename=kenhnv.xls");

?>

	 <table >
            <tr><td colspan="3" align="center" style="font-weight: bold; ">
<?php echo $tendv ['Zdv'] ['tendvcha'];?>
            </td>
            <td colspan="3" align="center" style="font-weight: bold; ">CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM</td>
            </tr>
            <tr>
            <td colspan="3" align="center" style="font-weight: bold; ">
             <?php
echo $tendv['Zdv'] ['tendv'];
?>
            
             </td>
                <td colspan="3" align="center" style="font-weight: bold; ">Độc lập- tự do- hạnh phúc</td>
            </tr>
            <tr>
            <td colspan="6" align="center" style="font-weight: bold; font-size: large;">
          THEO DÕI CÁC KÊNH ĐIỂM BÁN TỪ <?php echo date('d-m-Y',strtotime($ngaybd)); ?> ĐẾN <?php echo date('d-m-Y',strtotime($ngaykt)); ?> 
            </td>
            </tr>
             <tr>
            <td colspan="6" align="center" style="font-weight: bold; ">
          <?php echo '<strong>Nhân viên: '.$n ['Nhanvien']  ['manv'].'- '.
                $n ['Nhanvien'] ['tennv'].'</strong>';?>
            </td>
            </tr>
    </table>
    <br />
    <h3>I. CÔNG TÁC ĐIỂM BÁN</h3>
	<table cellpadding="0" cellspacing="0" border="1">
	<tr>
            <th style="background: #d5d5d5; font-weight:bold">STT</th>
			<th style="background: #d5d5d5; font-weight:bold">Mã kênh</th>
			<th style="background: #d5d5d5; font-weight:bold">Tên kênh</th>
			<th style="background: #d5d5d5; font-weight:bold">Hình ảnh</th>
			<th style="background: #d5d5d5; font-weight:bold">Poster</th>
			<th style="background: #d5d5d5; font-weight:bold">Tờ rơi</th>
			<th style="background: #d5d5d5; font-weight:bold">Ngày ghi</th>
	</tr>
	<?php
	$i = 0;
	foreach ($z1xemkenhs as $z1xemkenh):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $i; ?>&nbsp;</td>
		<td><?php echo $z1xemkenh['Z1xemkenh']['makenh']; ?>&nbsp;</td>
		<td><?php echo $z1xemkenh['Z1xemkenh']['tenkenh']; ?>&nbsp;</td>
		<td><?php echo $z1xemkenh['Z1xemkenh']['hinhanh']; ?>&nbsp;</td>
		<td><?php echo $z1xemkenh['Z1xemkenh']['poster']; ?>&nbsp;</td>
		<td><?php echo $z1xemkenh['Z1xemkenh']['toroi']; ?>&nbsp;</td>
		<td><?php echo $z1xemkenh['Z1xemkenh']['ngaytao']; ?>&nbsp;</td>
		
	</tr>
<?php endforeach; ?>
	</table>
    <br />
   <h3>II. THÔNG TIN THỊ TRƯỜNG</h3>
    	<table cellpadding="0" cellspacing="0" border="1">
	<tr>
            <th style="background: #d5d5d5; font-weight:bold">STT</th>
			<th style="background: #d5d5d5; font-weight:bold">Mã kênh</th>
			<th style="background: #d5d5d5; font-weight:bold">Tên kênh</th>
			<th style="background: #d5d5d5; font-weight:bold">Thông tin</th>
			<th style="background: #d5d5d5; font-weight:bold">Ghi chú</th>
			<th style="background: #d5d5d5; font-weight:bold">Ngày ghi</th>
	</tr>
	<?php
	$i = 0;
	foreach ($z2xemkenhs as $z2xemkenh):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $i; ?>&nbsp;</td>
		<td><?php echo $z2xemkenh['Z2xemkenh']['makenh']; ?>&nbsp;</td>
		<td><?php echo $z2xemkenh['Z2xemkenh']['tenkenh']; ?>&nbsp;</td>
		<td><?php echo $z2xemkenh['Z2xemkenh']['thitruong']; ?>&nbsp;</td>
		<td><?php echo $z2xemkenh['Z2xemkenh']['ghichu']; ?>&nbsp;</td>
		<td><?php echo $z2xemkenh['Z2xemkenh']['ngaytao']; ?>&nbsp;</td>
		
	</tr>
<?php endforeach; ?>
	</table>
    <br />
    <h3>III. TẦN SUẤT CHĂM SÓC</h3>
    <table cellpadding="0" cellspacing="0" border="1">
	<tr>
            <th style="background: #d5d5d5; font-weight:bold">STT</th>
			<th style="background: #d5d5d5; font-weight:bold">Mã kênh</th>
			<th style="background: #d5d5d5; font-weight:bold">Tên kênh</th>
			<th style="background: #d5d5d5; font-weight:bold">Ngày đi</th>
			<th style="background: #d5d5d5; font-weight:bold">Ghi chú</th>
	</tr>
	<?php
	$i = 0;
	foreach ($z3xemkenhs as $z3xemkenh):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $i; ?>&nbsp;</td>
		<td><?php echo $z3xemkenh['Z3xemkenh']['makenh']; ?>&nbsp;</td>
		<td><?php echo $z3xemkenh['Z3xemkenh']['tenkenh']; ?>&nbsp;</td>
		<td><?php echo $z3xemkenh['Z3xemkenh']['ngaydi']; ?>&nbsp;</td>
		<td><?php echo $z3xemkenh['Z3xemkenh']['ghichu']; ?>&nbsp;</td>
	</tr>
<?php endforeach; ?>
	</table>
	

